"""
字符串也是数据容器,字符串不可修改
相关操作
"""

s = "abshckiw"
print(s[0])
print(s[len(s) - 1])
print(s[-1])
print(s[0::2]) # asci

print(s.index("b"))

print(s.count("h"))
# s[0] = "h" 不可修改
# print(s)
s1 = s.replace("b", "h")
print(s1, "老字符串", s)

s2 = "ani da yea1a "
print("去除字符串前后空格", s2.strip())
print("去除字符串前后a字符", s2.strip("a"))
print(len(s))
